package com.hgx.entity;

import java.util.ArrayList;
import java.util.List;

import org.activiti.engine.repository.ProcessDefinition;

public class MyProcessDefinition {

	private String id;// 流程定义id
	private String name;// 流程名称
	private String key;// 流程KEY
	private Integer version;// 流程版本
	private String deploymentId;// 流程对象id
	private String resourceName;// 流程对象bmpn文件
	private String diagramResourceName;// 流程PNG文件

	private MyProcessDefinition(ProcessDefinition processDefinition) {
		super();
		this.id = processDefinition.getId();
		this.name = processDefinition.getName();
		this.key = processDefinition.getKey();
		this.version = processDefinition.getVersion();
		this.deploymentId = processDefinition.getDeploymentId();
		this.resourceName = processDefinition.getResourceName();
		this.diagramResourceName = processDefinition.getDiagramResourceName();
	}

	public static List<MyProcessDefinition> getInstanceList(List<ProcessDefinition> list) {
		if (list == null) {
			return null;
		}
		List<MyProcessDefinition> listmp = new ArrayList<MyProcessDefinition>();
		for (ProcessDefinition processDefinition : list) {
			listmp.add(new MyProcessDefinition(processDefinition));
		}
		return listmp;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public String getDeploymentId() {
		return deploymentId;
	}

	public void setDeploymentId(String deploymentId) {
		this.deploymentId = deploymentId;
	}

	public String getResourceName() {
		return resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}

	public String getDiagramResourceName() {
		return diagramResourceName;
	}

	public void setDiagramResourceName(String diagramResourceName) {
		this.diagramResourceName = diagramResourceName;
	}

}
